<template>
   <div>
   <input type="text">
   <div class="ref" ref="myref">666</div>
   <div v-html="divinner"></div>
    <div v-show="flag">{{divinner}}</div>
  <button @click="names">点击</button>
   </div>
</template>

<script>
export default {
  data() {
      return {
          divinner:"<div>181818</div>",
     flag:false ,
     str:"我无敌"    
      }
  },
  methods: {
      names() {
          console.log(this.$refs.myref);
          this.flag=!this.flag
          this.$refs.myref.innerHTML=this.str
      },
  },
  
}
</script>

<style>

</style>